package com.pxene.dmp.common;

import com.pxene.dmp.constant.BaseConstant;

public class KVUrlGenerator {

	private static String getCustSign() {
		String sign = "";
		try {
			sign = SAuthRss.getSign(BaseConstant.KV_USERNAME, UEncrypt.HASH_TYPE.MD5, 
					UEncrypt.getHash(UEncrypt.HASH_TYPE.MD5, BaseConstant.KV_PASSWORD), SAuthRss.SEED_TYPE.CURRENTDAY);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return sign;
	}
	
	public static String getCustUrl(String apiName) {
		return BaseConstant.KV_URL.replace("${apiname}", apiName)
				.replace("${username}", BaseConstant.KV_USERNAME)
				.replace("${sign}", getCustSign());
	}
	
	public static void main(String[] args) throws Exception {
		System.out.println(getCustSign());
	}
}
